package ofpof.web.converter;

import org.apache.commons.lang.StringUtils;
import org.bson.types.ObjectId;
import org.springframework.core.convert.converter.Converter;

public class ObjectIdConverter implements Converter<String, ObjectId> {

	@Override
	public ObjectId convert(String objectIdAsString) {
		if (StringUtils.isNotEmpty(objectIdAsString)) {
			return new ObjectId(objectIdAsString);
		}
		return null;
	}

}
